const tokenKey = 'userToken'

export const setToken = (token) => {
  localStorage.setItem(tokenKey, JSON.stringify(token))
}

export const getToken = () => {
  const token = localStorage.getItem(tokenKey)
  if (token) {
    return JSON.parse(token)
  }
  return null
}

export const removeToken = () => {
  localStorage.removeItem(tokenKey)
}
